Group Lasso
2018 2 라밑데 스터디
HyejuKim.ybigta
Concepts
HyejuKim.ybigta
Lasso : 우리가 알고 있는 변수 선택법
쉽게 말해 쓸모 없는 변수의 계수를 0으로 만들어 없애 버림
HyejuKim.ybigta
라쏘.. 기초 개념은 매번 발제되는 내용이라 무엇을 이야기할지..
HyejuKim.ybigta
공모전에서 갓진원님이 알려주셨던 그룹라쏘에 대해 조금 공부해보
기로 했다
HyejuKim.ybigta
그림으로 먼저
https://turbosnu.wordpress.com/2016/01/20/note-down-
feature-selection-for-adc/
HyejuKim.ybigta
Group Lasso
: submatrix of X with columns corresponding to the predictors in group
^( : the coefficient vector of that group
: the length of 
if it includes a group in the model then all coefficients in the group will be nonzero
패널티항에 그룹의 계수 벡터가 들어가므로, 이번엔 쓸모 없는 그룹은
날리고 쓸모 있는 그룹이면 그룹의 모든 계수가 살아남음
HyejuKim.ybigta
Group Lasso: 라쏘와 릿지 사이
Lasso :
Group Lasso:
Ridge :
Sparsity
Sparsity at factor level
Non sparsity
L1 norm sparsity 가능하도록 만들어주고,
L2 norm 그룹 계수 전체를 nonzero 만들어
HyejuKim.ybigta
1. 그룹 특성이 있을 경우
2. categorical variable
그룹 라쏘의 의미…?
HyejuKim.ybigta
참고: Sparse-group Lasso
2 types of sparsity:
1) groupwise sparsity : the number of groups with at least one
nonzero coefficient
2) within group sparsity: the number of nonzero coefficients within
each nonzero group
어떤 sparsity 집중?
전반적인 sparsity
HyejuKim.ybigta
Implementation
HyejuKim.ybigta
How to implement
1. Python pyglmnet (elasticnet, group)
2. R gglasso, grplasso(group lasso)
- SGL(spare group lasso)
HyejuKim.ybigta
How to implement
1. Python pyglmnet (elasticnet, group)
- Cv 기능이 오류남
- Lambda 찾아주는 함수 없음
- Dataset 마저 오류남
HyejuKim.ybigta
How to implement
2. R gglasso, grplasso(group lasso)
- SGL(spare group lasso)
선택한 package : gglasso
- cv 함수 존재
- cv error 최소 Lambda 찾아줌
HyejuKim.ybigta
1. 그룹화된 변수
Dataset : gglasso 있던 bio dataset bardet
https://cran.r-project.org/web/packages/gglasso/gglasso.pdf
x : a [120 x 100] matrix (expanded from a [120 x 20] matrix) giving the expression levels of 20
filtered genes for the 120 samples. Each row corresponds to a subject, each 5 consecutive
columns to a grouped gene.
y : a numeric vector of length 120 giving expression level of gene TRIM32, which causes Bardet-
Biedl syndrome.
HyejuKim.ybigta
gglasso
cv.gglasso(x, y, group, lambda = NULL,
pred.loss = c("misclass", "loss", "L1", "L2"),
nfolds = 5, foldid, delta, ...)
HyejuKim.ybigta
HyejuKim.ybigta
결과 비교
HyejuKim.ybigta
2. Categorical variable
Dataset : Kaggle bike sharing demand 일부
HyejuKim.ybigta
2. Categorical variable
Dataset : Kaggle bike sharing demand 일부
HyejuKim.ybigta
2. Categorical variable
Dataset : Kaggle bike sharing demand 일부
HyejuKim.ybigta
계수 비교 Multiple LR
HyejuKim.ybigta
계수 비교 Lasso vs Group Lasso
HyejuKim.ybigta
결과 비교
HyejuKim.ybigta
결론
생각보다 별로 dramatic score차이는 없었다
score 변화보다는 의미의 측면에서 유용하지 않을까
혹은 categorical variable 개수와 차원이 높은 경우에서 유용하
않을까
HyejuKim.ybigta
참고문헌
https://cran.r-project.org/web/packages/gglasso/gglasso.pdf
NOAH SIMON, A SPARSE-GROUP LASSO
Yuan and Lin, Model selection and estimation in regression with
grouped variables
HyejuKim.ybigta